package hapi.mvc;

class Subview implements View {
	
	var prefix:String;
	var view:View;
	
	public function new(view:View, prefix:String) {
		this.prefix = prefix;
		this.view = view;
	}
	
	public function assign(param:String, value:Dynamic):Void {
		view.assign(prefix + "_" + param, value);
	}
	
	public function assignDisplayable(obj:Displayable):Void {
		obj.displayOn(this);
	}
	
	public function display():Void {
		view.display();
	}
}